package com.ay.weixin.config.types;

import java.util.List;

import javax.servlet.ServletContext;

import org.lizar.Web;
import org.lizar.config.group.Explain;
import org.lizar.config.group.Group;
import org.lizar.controller.loader.EventLoader;

/**
 * 
 * kanfang_status
 * kanfang_status_extra
 * 看房状态
 * 
 * */
public enum KanFangStatus {
	wait_to_process(0,"最新推荐"),
	not_connect(1,"未接通"),
	follow(2,"跟进中"),
	ready_to_visit(3,"有意向未到访"),
	ready_to_sign(4,"已到访未签约"),
	sign_ing(5,"签约中"),
	sign_success(6,"签约成功"),
	failed_close(7,"审核未通过或无意向"),
	black_list(8,"黑名单(恶意提交)"),
	return_cash(9,"已发放佣金"),
	finish(10,"看房结束");
	
	private int value;
	private String desc;
	private KanFangStatus(int value,String desc){
		this.value=value;
		this.desc=desc;
	}

	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static String getDesc(int value){
		for(KanFangStatus status:values()){
			if(status.getValue()==value){
				return status.getDesc();
			}
		}
		return "最新推荐";
	}
	
	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public static void loadToAppAttr(){
		ServletContext context=Web.context;
		context.setAttribute("kslist", values());
		context.setAttribute("sign_success", KanFangStatus.sign_success);
		context.setAttribute("failed_close",KanFangStatus.failed_close);
		context.setAttribute("black_list", KanFangStatus.black_list);
		context.setAttribute("cash_return", KanFangStatus.return_cash);
		context.setAttribute("book_finish", KanFangStatus.finish);
		context.setAttribute("sign_ing", KanFangStatus.sign_ing);
		context.setAttribute("ready_to_sign", KanFangStatus.ready_to_sign);
	}
}
